<template>
  <button @click="goLogin">登录</button>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { useRoute, useRouter } from "vue-router";
// import axios from "axios";
import { setToken } from "@/utils/auth";
export default defineComponent({
  name: "login",
  props: {},
  setup(props, context) {
    const route = useRoute();
    const router = useRouter();
    const goLogin = () => {
      setToken("logined");
      // path: route.query.old ? route.query.old :
      router.replace("/");
    };
    return {
      goLogin,
    };
  },
});
</script>

<style scoped lang="less">
</style>
